<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>6_3_2-3-生命周期</title>
</head>

<body>


  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  <div id="Application">
    <my-com></my-com>
  </div>
  <script>
    //定义一个组件，名为App
    const App = Vue.createApp({});
    const myMixin = {
      mounted() {
        console.log("Mixin对象mounted");
      },
    };
    const com = {
      mixins: [myMixin],
      template: `<div>组件内容</div>`,
      mounted() {
        console.log("组件本身mounted");
      },
    };
    App.component("my-com", com);
    App.mount("#Application"); //将Vue组件绑定到页面上id为Application的元素上。
  </script>
</body>

</html>